<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Link Loss Service</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51822 BLE SDK
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__ble__sdk__srv__lls.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Link Loss Service</div>  </div>
<div class="ingroups"><a class="el" href="group__ble__sdk__srv.html">Bluetooth Services</a></div></div>
<div class="contents">

<p>Link Loss Service module.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__lls__evt__t.html">ble_lls_evt_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Link Loss Service event.  <a href="structble__lls__evt__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__lls__init__t.html">ble_lls_init_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Link Loss Service init structure. This contains all options and data needed for initialization of the service.  <a href="structble__lls__init__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__lls__s.html">ble_lls_s</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Link Loss Service structure. This contains various status information for the service.  <a href="structble__lls__s.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae3a4320ff2f496c898601a41a9832a07"></a><!-- doxytag: member="ble_sdk_srv_lls::ble_lls_t" ref="gae3a4320ff2f496c898601a41a9832a07" args="" -->
typedef struct <a class="el" href="structble__lls__s.html">ble_lls_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Link Loss Service structure. This contains various status information for the service. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2ff59fd3c572afa373d8731265a2daee"></a><!-- doxytag: member="ble_sdk_srv_lls::ble_lls_evt_handler_t" ref="ga2ff59fd3c572afa373d8731265a2daee" args=")(ble_lls_t *p_lls, ble_lls_evt_t *p_evt)" -->
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__lls.html#ga2ff59fd3c572afa373d8731265a2daee">ble_lls_evt_handler_t</a> )(<a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a> *p_lls, <a class="el" href="structble__lls__evt__t.html">ble_lls_evt_t</a> *p_evt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Link Loss Service event handler type. <br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__lls.html#ga94331ff0a90e8f8b61dcf230e1760ccf">ble_lls_evt_type_t</a> { <a class="el" href="group__ble__sdk__srv__lls.html#gga94331ff0a90e8f8b61dcf230e1760ccfa2b53ad90d2e6afd7294ca052768d7438">BLE_LLS_EVT_LINK_LOSS_ALERT</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Link Loss Service event type.  <a href="group__ble__sdk__srv__lls.html#ga94331ff0a90e8f8b61dcf230e1760ccf">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__lls.html#ga7f1365b395cf05261b2f659dc3ed992b">ble_lls_init</a> (<a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a> *p_lls, const <a class="el" href="structble__lls__init__t.html">ble_lls_init_t</a> *p_lls_init)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the Link Loss Service.  <a href="#ga7f1365b395cf05261b2f659dc3ed992b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__lls.html#ga8016405e451656f510b244e4cbe09653">ble_lls_on_ble_evt</a> (<a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a> *p_lls, <a class="el" href="structble__evt__t.html">ble_evt_t</a> *p_ble_evt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Link Loss Service BLE stack event handler.  <a href="#ga8016405e451656f510b244e4cbe09653"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__lls.html#gac11e8cb48c16a1d07dd0c1d6c649fdad">ble_lls_alert_level_get</a> (<a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a> *p_lls, uint8_t *p_alert_level)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current value of the Alert Level characteristic.  <a href="#gac11e8cb48c16a1d07dd0c1d6c649fdad"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Link Loss Service module. </p>
<p>This module implements the Link Loss Service with the Alert Level characteristic. During initialization it adds the Link Loss Service and Alert Level characteristic to the BLE stack database.</p>
<p>The application must supply an event handler for receiving Link Loss Service events. Using this handler, the service will notify the application when the link has been lost, and which Alert Level has been set.</p>
<p>The service also provides a function for letting the application poll the current value of the Alert Level characteristic.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The application must propagate BLE stack events to the Link Loss Service module by calling <a class="el" href="group__ble__sdk__srv__lls.html#ga8016405e451656f510b244e4cbe09653" title="Link Loss Service BLE stack event handler.">ble_lls_on_ble_evt()</a> from the <a class="el" href="group__ble__stack__handler.html">BLE Stack Event Handler</a> callback. </dd></dl>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga94331ff0a90e8f8b61dcf230e1760ccf"></a><!-- doxytag: member="ble_lls.h::ble_lls_evt_type_t" ref="ga94331ff0a90e8f8b61dcf230e1760ccf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__ble__sdk__srv__lls.html#ga94331ff0a90e8f8b61dcf230e1760ccf">ble_lls_evt_type_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Link Loss Service event type. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga94331ff0a90e8f8b61dcf230e1760ccfa2b53ad90d2e6afd7294ca052768d7438"></a><!-- doxytag: member="BLE_LLS_EVT_LINK_LOSS_ALERT" ref="gga94331ff0a90e8f8b61dcf230e1760ccfa2b53ad90d2e6afd7294ca052768d7438" args="" -->BLE_LLS_EVT_LINK_LOSS_ALERT</em>&nbsp;</td><td>
<p>Alert Level Updated event. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="ble__lls_8h_source.html#l00044">44</a> of file <a class="el" href="ble__lls_8h_source.html">ble_lls.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga7f1365b395cf05261b2f659dc3ed992b"></a><!-- doxytag: member="ble_lls.h::ble_lls_init" ref="ga7f1365b395cf05261b2f659dc3ed992b" args="(ble_lls_t *p_lls, const ble_lls_init_t *p_lls_init)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_lls_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a> *&#160;</td>
          <td class="paramname"><em>p_lls</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structble__lls__init__t.html">ble_lls_init_t</a> *&#160;</td>
          <td class="paramname"><em>p_lls_init</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the Link Loss Service. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">p_lls</td><td>Link Loss Service structure. This structure will have to be supplied by the application. It will be initialized by this function, and will later be used to identify this particular service instance. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_lls_init</td><td>Information needed to initialize the service. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on successful initialization of service, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__lls_8c_source.html#l00122">122</a> of file <a class="el" href="ble__lls_8c_source.html">ble_lls.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga8016405e451656f510b244e4cbe09653"></a><!-- doxytag: member="ble_lls.h::ble_lls_on_ble_evt" ref="ga8016405e451656f510b244e4cbe09653" args="(ble_lls_t *p_lls, ble_evt_t *p_ble_evt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_lls_on_ble_evt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a> *&#160;</td>
          <td class="paramname"><em>p_lls</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structble__evt__t.html">ble_evt_t</a> *&#160;</td>
          <td class="paramname"><em>p_ble_evt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Link Loss Service BLE stack event handler. </p>
<p>Handles all events from the BLE stack of interest to the Link Loss Service.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_lls</td><td>Link Loss Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ble_evt</td><td>Event received from the BLE stack. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__lls_8c_source.html#l00059">59</a> of file <a class="el" href="ble__lls_8c_source.html">ble_lls.c</a>.</p>

</div>
</div>
<a class="anchor" id="gac11e8cb48c16a1d07dd0c1d6c649fdad"></a><!-- doxytag: member="ble_lls.h::ble_lls_alert_level_get" ref="gac11e8cb48c16a1d07dd0c1d6c649fdad" args="(ble_lls_t *p_lls, uint8_t *p_alert_level)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_lls_alert_level_get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__lls.html#gae3a4320ff2f496c898601a41a9832a07">ble_lls_t</a> *&#160;</td>
          <td class="paramname"><em>p_lls</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_alert_level</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get current value of the Alert Level characteristic. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_lls</td><td>Link Loss Service structure. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">p_alert_level</td><td>Current Alert Level value. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__lls_8c_source.html#l00150">150</a> of file <a class="el" href="ble__lls_8c_source.html">ble_lls.c</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
